package com.flash.BusinessParameters.mapper;

import com.flash.BusinessParameters.entity.Cash;
import com.flash.BusinessParameters.entity.FundSetting;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface CashMapper {

    @Select("select * from (select rownum rn,c.* from cash c) where 1=1 ${accountName} and rn between #{page} and #{limit}")
    public List<Cash> selectCashMap(Map map);

    @Delete("delete from cash where cashId = #{cashId}")
    public int deleteCash(String cashId);

    @Insert("insert into cash values(#{cashId},#{bankId},#{accountName},#{bankName},#{stockpileType},#{cardRetes},#{bearingTime},#{openTime},#{endTime},#{cashRemark})")
    public int insertCash(Cash cash);

    @Select("select * from Cash")
    public List<Cash> selectCash();

    @Select("select count(*) from Cash")
    public int selectCountCash();

    @Update("update cash set bankId=#{bankId},accountName=#{accountName},bankName=#{bankName},stockpileType=#{stockpileType},cardRetes=#{cardRetes},bearingTime=#{bearingTime},openTime=#{openTime},endTime=#{endTime},cashRemark=#{cashRemark} where cashId = #{cashId}")
    public int updateCash(Cash cash);
}
